import java.awt.event.*;
import javax.swing.*;

public class GUImsgButton extends JButton implements ActionListener{
	private GUI gui;
	private GUIchannel guiChannel;

	public GUImsgButton(GUI gui) {
		this.gui = gui;
	}
	
	public GUImsgButton(GUIchannel guiChannel, GUI gui) {
		this.gui = gui;
		this.guiChannel = guiChannel;
	}
	
	public void actionPerformed(ActionEvent e) {
		if(e.getActionCommand().equals("Query")) {
			gui.sendMsg();
		} else if(e.getActionCommand().equals("Send")) {
			guiChannel.sendMsg();
		} else if(e.getActionCommand().equals("Close")) {
			gui.getClient().leaveChannel(guiChannel.getChannelName());
		}
	}
}
